package com.atguigu.ssyx.home.controller;

import com.atguigu.ssyx.client.product.ProductFeignClient;
import com.atguigu.ssyx.common.result.Result;
import com.atguigu.ssyx.model.product.Category;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * ClassName: CategoryApiController
 * Package: com.atguigu.ssyx.home.controller
 * Description:
 *
 * @Author: 比特张
 * @Create: 2023/7/24 - 15:52
 * @Version: v1.0
 */
@Api(tags = "商品分类")
@RestController
@RequestMapping("/api/home")
public class CategoryApiController {
    @Resource
    private ProductFeignClient productFeignClient;

    @ApiOperation("查询所有分类")
    @GetMapping("/category")
    public Result<List<Category>> categoryList() {
        List<Category> categoryList = productFeignClient.findAllCategoryList();
        return Result.ok(categoryList);
    }

}
